public class Test {

    public static void main(String[] args) {
        String str1 = "welcome to cvte";
        String str2 = "cvte";
        String str = func(str1, str2);
        System.out.println(str);
    }

    private static String func(String str1, String str2) {
        StringBuilder stringBuilder = new StringBuilder();
        boolean flag = true;
        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if (str2.indexOf(ch)==-1){
                stringBuilder.append(ch);
            }

        }
        return stringBuilder.toString();
    }


    /*private static String func(String str1, String str2) {
        StringBuilder stringBuilder = new StringBuilder();
        boolean flag = true;
        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if (!str2.contains(ch+"")){
                stringBuilder.append(ch);
            }

        }
        return stringBuilder.toString();
    }
*/
    /*private static String func(String str1, String str2) {
        StringBuilder stringBuilder = new StringBuilder();
        boolean flag = true;
        for (int i = 0; i < str1.length(); i++) {
            for (int j = 0; j < str2.length(); j++) {
                if (str1.charAt(i) != str2.charAt(j)) {
                    flag = true;
                    //break;
                } else {
                    flag = false;
                    break;
                }
            }
            if (flag == true) {
                stringBuilder.append(str1.charAt(i));
            }
        }
        return stringBuilder.toString();
    }*/
}
